package com.carp.springframework.beans.factory.config;

import com.carp.springframework.beans.PropertyValues;
import lombok.Getter;

import java.util.Optional;

/**
 * @author lile
 * @date 2023/2/2
 */
@Getter
public class BeanDefinition {

    private final Class<?> beanClass;

    private final PropertyValues propertyValues;

    public BeanDefinition(Class<?> beanClass) {
        this.beanClass = beanClass;
        this.propertyValues = new PropertyValues();
    }

    public BeanDefinition(Class<?> beanClass, PropertyValues propertyValues) {
        this.beanClass = beanClass;
        this.propertyValues = Optional.ofNullable(propertyValues).orElse(new PropertyValues());
    }
}
